package org.bing.zion.core;

import java.io.IOException;
import java.nio.ByteBuffer;

public interface ProtocolFilter {

	/** session lifecycle */
	public abstract void sessionCreated(ProtocolFilterChain chain, Session session) throws IOException;

	public abstract void sessionOpened(ProtocolFilterChain chain, Session session) throws IOException;

	public abstract void sessionClosed(ProtocolFilterChain chain, Session session) throws IOException;

	/** message lifecycle */
	public abstract void messageReceived(ProtocolFilterChain chain, Session session, Object message) throws IOException;

	public abstract void messageSent(ProtocolFilterChain chain, Session session, Object message) throws IOException;

	public abstract void messageFlush(ProtocolFilterChain chain, Session session, ByteBuffer buf) throws IOException;

}